
#include <dev.h>
#include "pci.h"

/* ------------------------------------------------------------------------- */

static pci_dev_t usb_dev[2];

static void fastcall usb_config(uint8 reg, uint32 data, uint32 mask);
static size_t fastcall usb_map_size(uint map);
static size_t fastcall usb_read_map(uint map, uint32 addr, void *data, size_t size);
static size_t fastcall usb_write_map(uint map, uint32 addr, const void *data, size_t size);

/* ------------------------------------------------------------------------- */

pci_dev_t *get_usb1_device(void)
{
	memset(&usb_dev[0], 0, sizeof(usb_dev[0]));

#ifndef NDEBUG
	strcpy(usb_dev[0].name, "USB1");
#endif

	usb_dev[0].config = &usb_config;
	usb_dev[0].map_size = &usb_map_size;
	usb_dev[0].read_map = &usb_read_map;
	usb_dev[0].write_map = &usb_write_map;

	return &usb_dev[0];
}

pci_dev_t *get_usb2_device(void)
{
	memset(&usb_dev[1], 0, sizeof(usb_dev[1]));

#ifndef NDEBUG
	strcpy(usb_dev[1].name, "USB2");
#endif

	usb_dev[1].config = &usb_config;
	usb_dev[1].map_size = &usb_map_size;
	usb_dev[1].read_map = &usb_read_map;
	usb_dev[1].write_map = &usb_write_map;

	return &usb_dev[1];
}

/* ------------------------------------------------------------------------- */

static void fastcall usb_config(uint8 reg, uint32 data, uint32 mask)
{

}

static size_t fastcall usb_map_size(uint map)
{
	return 0;
}

static size_t fastcall usb_read_map(uint map, uint32 addr, void *data, size_t size)
{
	return size;
}

static size_t fastcall usb_write_map(uint map, uint32 addr, const void *data, size_t size)
{
	return size;
}

/* ------------------------------------------------------------------------- */
